﻿<UserControl x:Class="Net.Chirash.Twitter.TweetZone.WindowComponents.ZonePanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:wc="clr-namespace:Net.Chirash.Twitter.TweetZone.WindowComponents"
             xmlns:vm="clr-namespace:Net.Chirash.Twitter.TweetZone.WindowComponents.ViewModels"
             mc:Ignorable="d" 
             x:Name="rootControl"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <vm:ZoneContainerCollection x:Key="ZoneContainerCollectionKey" />
    </UserControl.Resources>
    <DockPanel>
        <ListBox x:Name="ContainerBox" 
                     ItemsSource="{Binding Source={StaticResource ZoneContainerCollectionKey}}"
                     HorizontalContentAlignment="Left"
                     VerticalContentAlignment="Stretch"
                     MouseMove="rootControl_MouseMove"
                     MouseLeftButtonDown="rootControl_MouseLeftButtonDown"
                     ScrollViewer.HorizontalScrollBarVisibility="Visible"  
                     ScrollViewer.VerticalScrollBarVisibility="Disabled" 
                     ScrollViewer.CanContentScroll="False" 
                    >
            <ListBox.Resources>
                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray" />
                <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Gray" />
            </ListBox.Resources>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Name="ContainersStackPanel"
                                    Orientation="Horizontal"
                                    />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <!--<ListBox.ItemContainerStyle>
                    
                    <Style TargetType="{x:Type ListBoxItem}" >
                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" Value="{StaticResource GreyBrush}" />
                                <Setter Property="Foreground" Value="{StaticResource GreyBrush}" />
                            </Trigger>
                            <Trigger Property="IsSelected" Value="false">
                                <Setter Property="Background" Value="{StaticResource DarkBrush}" />
                                <Setter Property="Foreground" Value="{StaticResource DarkBrush}" />
                            </Trigger>

                        </Style.Triggers>
                    </Style>

                </ListBox.ItemContainerStyle>-->
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <wc:ZoneController DataContext="{Binding .}"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </DockPanel>
</UserControl>
